package com.jacky.me.jnidemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.jacky.me.jnidemo.calljni.EffectUtils;

import org.fmod.FMOD;


/**
 * Created by jacky on 2017/4/13.
 * banker devel0per
 * <p></p>
 */
public class SoundActivity extends AppCompatActivity {

    private EffectUtils mEffectUtils;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sound);
        FMOD.init(this);
    }
    public void mFix(View v) {
        //音频路径可以去获取麦克风的数据，我这里写死了
        String path = "file:///android_asset/zph.wav";
        switch (v.getId()) {
            case R.id.btn_normal:
                Toast.makeText(this, "原声", Toast.LENGTH_SHORT).show();
                EffectUtils.fix(path, EffectUtils.MODE_NORMAL);
                break;
            case R.id.btn_luoli:
                EffectUtils.fix(path, EffectUtils.MODE_LUOLI);
                break;
            case R.id.btn_dashu:
                EffectUtils.fix(path, EffectUtils.MODE_DASHU);
                break;
            case R.id.btn_jingsong:
                EffectUtils.fix(path, EffectUtils.MODE_JINGSONG);
                break;
            case R.id.btn_gaoguai:
                EffectUtils.fix(path, EffectUtils.MODE_GAOGUAI);
                break;
            case R.id.btn_kongling:
                EffectUtils.fix(path, EffectUtils.MODE_KONGLING);
                break;
            default:
                break;
        }
    }

    @Override
    protected void onDestroy() {
        // TODO Auto-generated method stub
        super.onDestroy();
        FMOD.close();
    }
}
